import request from '@/config/axios'

// 活动分类 VO
export interface ActivityTypeVO {
  id: number // 编号
  categoryId: number // 种类ID
  parentId: number // 父级ID
  name: string // 分类名称
  sort: number // 排序
  status: number // 状态
}

// 活动分类 API
export const ActivityTypeApi = {
  // 查询活动分类列表
  getActivityTypeList: async (params) => {
    return await request.get({ url: `/school/activity-type/list`, params })
  },

  // 查询活动分类列表
  getSimpleActivityTypeList: async (params) => {
    return await request.get({ url: `/school/activity-type/simple-list`, params })
  },

  // 查询活动分类详情
  getActivityType: async (id: number) => {
    return await request.get({ url: `/school/activity-type/get?id=` + id })
  },

  // 新增活动分类
  createActivityType: async (data: ActivityTypeVO) => {
    return await request.post({ url: `/school/activity-type/create`, data })
  },

  // 修改活动分类
  updateActivityType: async (data: ActivityTypeVO) => {
    return await request.put({ url: `/school/activity-type/update`, data })
  },

  // 删除活动分类
  deleteActivityType: async (id: number) => {
    return await request.delete({ url: `/school/activity-type/delete?id=` + id })
  },

  // 导出活动分类 Excel
  exportActivityType: async (params) => {
    return await request.download({ url: `/school/activity-type/export-excel`, params })
  },
}
